package com.joe;

import com.joe.core.JatisContext;
import com.joe.dao.TestDao;
import com.joe.entity.Employee;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.sql.SQLException;
import java.util.List;

/**
 * Created by joe on 2018/11/25
 */
public class Main {
    private static final Logger logger = LoggerFactory.getLogger(Main.class);

    private static final TestDao testDao = JatisContext.getDao(TestDao.class);

    public static void main(String[] args) throws ClassNotFoundException, SQLException {
        delete();
    }

    private static void insert() {
        Employee employee = new Employee("joe", "人工智能大佬", "666");
        boolean result = testDao.insert(employee);
        System.out.println();
    }

    private static void delete() {
        testDao.deleteById(1);
        System.out.println();
    }

    private static void update() {
        int result = testDao.update("牛比");
        System.out.println();
    }

    private static void select() {
        List<Employee> results = testDao.select(10);
        System.out.println();
    }

}
